package com.xueyu.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xueyu.domain.HouseBean;
import com.xueyu.domain.Stayinfo.StayinfoBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface StayinfoDao extends BaseMapper<StayinfoBean> {

    List<StayinfoBean> listPage();

    List<StayinfoBean> list();

    @Select("select s.*,b.bedNo,p.realName from stayinfo s" +
            " left join bed b on s.bedId = b.bedId" +
            " left join personinfo p on  s.personId = p.personId" +
            " where p.realName like '%${search}%'")
    List<StayinfoBean> selectLeftJoin(@Param("search") String search, Page<StayinfoBean> page);
}
